package com.nd.android.u.ui.messageCreator;

import android.content.Context;

import com.nd.android.u.controller.ChatConst.MessageContentType;
import com.nd.android.u.controller.innerInterface.IChatListItem;
import com.nd.android.u.controller.innerInterface.IMessageDisplay;
import com.nd.android.u.controller.outInterface.IMessageCreator;
import com.nd.android.u.ui.activity.message_chat.ChatActivity_Person;
import com.nd.android.u.ui.beanStarApp.DisplayMessage_Person;
import com.nd.android.u.ui.widge.ChatListItemView_Audio;
import com.nd.android.u.ui.widge.ChatListItemView_Image;
import com.nd.android.u.ui.widge.ChatListItemView_Text;

/**
 * 个人消息生产者
 * <br>Created 2014-8-20 上午10:09:07
 * @version  
 * @author   cb		
 * @see 	 
 */
public class PersonMessageCreator implements IMessageCreator {
	@Override
	public IMessageDisplay getMessageDisplay(int iParam,String sParam) {
		return new DisplayMessage_Person();
	}

	@Override
	public Class<?> getDisplayClass(IMessageDisplay message) {
		return ChatActivity_Person.class;
	}

	@Override
	public IChatListItem getMessageView(Context context, IMessageDisplay message, boolean getParentOnly) {
		IChatListItem item;
		switch (message.getMessageContentType()) {
		case MessageContentType.AUDIO:
		case MessageContentType.OLD_AUDIO:
			item=new ChatListItemView_Audio(context);
			break;
		case MessageContentType.TEXT:
			item=new ChatListItemView_Text(context);
			break;
		case MessageContentType.PICTURE:
			item=new ChatListItemView_Image(context);
			break;
		default:
			return null;
		}
		return item;
	}
}
